home *** CD-ROM | disk | FTP | other *** search
- package horst;
-
- import java.awt.Component;
- import java.awt.Container;
- import java.util.Vector;
- import javax.swing.JPanel;
-
- public class FrameSetPanel extends JPanel {
- FrameSplitterBar[] bars;
-
- void doConstraintLayout() {
- ((FrameSetLayout)((Container)this).getLayout()).doConstraintLayout();
- }
-
- private FrameSplitterBar[] getBars() {
- Vector temp = new Vector();
- Component[] comps = ((Container)this).getComponents();
-
- for(int i = 0; i < comps.length; ++i) {
- if (comps[i] instanceof FrameSplitterBar) {
- temp.addElement(comps[i]);
- }
- }
-
- FrameSplitterBar[] bars = new FrameSplitterBar[temp.size()];
- temp.copyInto(bars);
- return bars;
- }
-
- FrameSplitterBar getLeftSplitBar(FrameSplitterBar target) {
- FrameSplitterBar[] bars = this.getBars();
-
- for(int i = 0; i < bars.length; ++i) {
- if (bars[i] == target) {
- if (i > 0) {
- return bars[i - 1];
- }
-
- return null;
- }
- }
-
- return null;
- }
-
- FrameSplitterBar getRightSplitBar(FrameSplitterBar target) {
- FrameSplitterBar[] bars = this.getBars();
-
- for(int i = 0; i < bars.length; ++i) {
- if (bars[i] == target) {
- if (i + 1 < bars.length) {
- return bars[i + 1];
- }
-
- return null;
- }
- }
-
- return null;
- }
- }
-